package com.sl.au.service;

import java.util.List;
import java.util.Map;

import com.sl.au.entity.Chance;
import com.sl.au.entity.ChanceStatistics;
import com.sl.au.entity.User;
import com.sl.au.repository.ChanceRepository;

public interface ChanceService extends BaseService {
	ChanceRepository getRepository();

	/**
	 * 快速查询获取分页数据
	 * 
	 * @param start
	 * @param length
	 * @param key
	 * @param orderName
	 * @param dir
	 * @return
	 */
	List<Chance> getSaleChances(int start, int length, Map<String, String> condition, String orderName, String dir);

	/**
	 * 快速查询获取分页数据总数
	 * 
	 * @param start
	 * @param length
	 * @param key
	 * @param orderName
	 * @param dir
	 * @return
	 */
	int getSaleChanceCount(Map<String, String> condition);

	/**
	 * 信息查询分页数据
	 * 
	 * @param start
	 * @param length
	 * @param key
	 * @param orderName
	 * @param dir
	 * @return
	 */
	List<Chance> getQueryChances(int start, int length, Map<String, String> condition, User user, String orderName,
			String dir);

	/**
	 * 信息查询分页数据条数
	 * 
	 * @param userId
	 * @param key
	 * @return
	 */
	Long getQueryCount(Map<String, String> condition, User user);

	/**
	 * 获得客户的小苏信息
	 */
	List<Chance> getCustomerChances(int start, int length, String customerId, String key);

	long getCustomerChancesCount(String customerId, String key);

	List<Chance> getQueryChancesHql(int start, int length, Map<String, Object> condition, User user, String orderName,
			String dir);

	long getQueryChancesCountHql(Map<String, Object> condition, User user);

	List<ChanceStatistics> getChanceStatistics(Integer year, int i, String superior);
}
